<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
{{assign var="title" value=$title|default:'文章'}}
{{assign var="app" value='listing'}}
{{assign var="act" value='index'}}
{{assign var="table" value='datas'}}
{{assign var="td" value='10'}}
<title>{{$title}}管理 - {{'admin|admin_site_name'|C|default:'后台管理'}}</title>
{{include file="include/base.html"}}
{{include file="{{$smarty.const.PLUG}}chosen/chosen.html"}}
{{include file="{{$smarty.const.PLUG}}drag/drag.html"}}
</head>
<body>

{{include file="include/sidebar.html"}}

<div class="body_right">
	<div id="content">
	
	<div class="search">
	<form action="index.php" name='search' class="router" method="get">
		<input type="hidden" name="app" value="{{$app}}"/>
		<input type="hidden" name="item" value="{{$smarty.get.item}}"/>
		<ul class="bread">
			<li class="floatr">
			</li>
			<li>
				id：<input type="text" class="input-mini" name="id" value="{{$smarty.get.id}}" />
			</li>
			<li>
				标题：<input class="input-small" type="text" name="title" maxlength="50" value="{{$smarty.get.title}}" />
			</li>
			<li>
				<select name="publish" class="chosen">
					<option {{if $smarty.get.publish==''}}selected="true"{{/if}} value="">全部</option>
					<option {{if $smarty.get.publish==1}}selected="true"{{/if}} value="1">已发布</option>
					<option {{if $smarty.get.publish=='0'}}selected="true"{{/if}} value="0">未发布</option>
				</select>
			</li>
			<li>
				<button type="submit" class="search btn btn-success"><i class="icon-search"></i>搜索</button>
				<a href="index.php?app={{$app}}&act={{$act}}{{if $smarty.get.item}}&item={{$smarty.get.item}}{{/if}}" class="a">清除</a>
			</li>
		</ul>
	</form>
	</div>

	<form name='form' action="index.php?app={{$app}}" method="post">
	<input type="hidden" name="app" value="{{$app}}"/>
	<input type="hidden" name="act" value=""/>
	<input type="hidden" name="table" value="{{$table}}"/>
	<table class="table table-bordered tablest drags saveorder" date="{{'table='|cat:$table|cat:'&field=ordering'|encode}}" >
		<tr class="thead">
			<td colspan="{{$td}}">
				<div class="floatr">
					<a class="btn iframe" href="index.php?app={{$app}}&act=modify&item={{$smarty.request.item}}{{if $smarty.get.tpl}}&tpl={{$smarty.get.tpl}}{{/if}}&iframe=true"><i class="icon-plus"></i>添加{{$title}}</a>
					<a class="delete btn btn-danger" href="javascript:"><i class="icon-trash icon-white"></i>批量删除</a>
				</div>
				◆ {{if !$smarty.get.item}}
				<a href="index.php?app={{$app}}&act=type">{{$title}}管理</a> －> 
				<a href="index.php?app={{$app}}&cat_id={{$parent_cat.id}}">{{$parent_cat.title}}</a> －>
				{{/if}}
				{{$title}}列表
			</td>
		</tr>
		{{if !$result.data}}
		<tr class="noline"><td colspan="{{$td}}" class="result_empty"></td></tr>
		{{else}}
		<tr class="ttitle">
			<th width="20"><label><input class="check_all" type="checkbox"/></label></th>
			<th width="35">ID</th>
			<th width="">{{$title}}标题</th>
			<th width="100">图片</th>
			<th width="30">推荐</th>
			<th width="30">状态</th>
			<th width="60">排序  <img title="保存排序" class="save_order" style="width:20px;height:20px;cursor:pointer;" src="{{$smarty.const.__APP__}}images/system/save.png"/></th>
			<th width="80">操作</th>
		</tr>
		<tbody>
			{{foreach from=$result.data item=val key=key}}
			<tr class="drag">
				{{*全选*}}<td><label><input name="check_id[]" class="check_id" value="{{$val.id}}" type="checkbox"/></label></td>
				{{*ID*}}<td>{{$val.id}}<input name="ids[]" value="{{$val.id}}" type="hidden"/></td>
				{{*标题*}}<td><a target="_blank" href="{{$smarty.const.__PROJECT__}}index/index/id-{{$val.id}}/" class="a">{{$val.title}}</a></td>
				{{*图片*}}<td>{{if $val.image}}<a class="zoom" title="{{$val.title}}" href="{{$val.image|photo}}"><img style="max-width:35px;max-height:35px;" src="{{$val.image|photo:35:35}}"/></a>{{/if}}</td>
				{{*推荐*}}<td>{{if $val.hot==1}}<img src="{{$smarty.const.__APP__}}images/system/hot.gif"/>{{/if}}</td>
				{{*状态*}}<td> <a class="ajaxSubmit refresh" link="index.php?app=functions&act=setValue&value={{!$val.publish}}&params={{'table='|cat:$table|cat:'&field=publish&id='|cat:$val.id|encode}}"><span class="select_{{$val.publish}}"></span></a> </td>
				{{*排序*}}<td><input class="is_number" maxlength="4" type='text' name="order[]" style="width:25px;" value='{{$val.ordering}}'/></td>
				<td>
					<a href="index.php?app={{$app}}&act=modify&id={{$val.id}}&item={{$smarty.request.item}}{{if $smarty.get.tpl}}&tpl={{$smarty.get.tpl}}{{/if}}&iframe=true" class="btn iframe"><i class="icon-edit"></i>编辑</a>
				</td>
			</tr>
			{{/foreach}}
			<tr class="noline ttitle">
				<td colspan="{{$td}}">
					<a class="check_all btn"><i class="icon-ok"></i>全选/反选</a>
				</td>
			</tr>
			<tr class="thead">
			  <td colspan="{{$td}}">
				{{include file="include/page.html"}}
			  </td>
			</tr>
		</tbody>
		{{/if}}
	</table>
	</form>
</div>
</div>

</body>
</html>